<template>
  <view class="content">
    <view class="iconfont icon_box iconduigou"></view>
    <view class="icon_text">充值成功</view>
    <view class="order_form">
      <view class="form_item">
        <view class="item_label">订单号</view>
        <view class="item_value">{{ordersn}}</view>
      </view>
      <view class="form_item">
        <view class="item_label">充值金额</view>
        <view class="item_value">{{money}}元</view>
      </view>
      <view class="form_item" v-if="extra != ''">
        <view class="item_label">赠送余额</view>
        <view class="item_value">{{extra}}元</view>
      </view>
    </view>
    <view class="bottom_btn" @tap="goHome">返回</view>
    <!-- <view class="bottom_btn2" @tap="goHome">回首页</view> -->
  </view>
</template>

<script>
import './success.scss';
import Taro from '@tarojs/taro';
import UserAPI from "../../api/user.js"
export default {
  data() {
    return {
      result: {},
      ordersn: "",
      money: "",
      extra: ""
    }
  },
  mounted(){
    var query = Taro.getCurrentInstance().router.params;
    this.ordersn = query.ordersn;
    this.money = query.money;
    this.extra = query.extra || "";
  },
  methods: {
    goBack(){
      Taro.navigateBack();
    },
    goHome(){
      Taro.navigateBack({delta: 4})
    }
  }
}

</script>
